<div class="custom">

    <h1>
        今日采购单
    </h1>


    <form class="row form-inline" >
        <div class="row" style="margin-left:0px">
            <div class="form-group col-md-3">
                <label class="">截止日期</label>
                <input class=" form-control" type="date" ng-model="queryData.ctime_like" placeholder="截止日期" value="queryData.ctime_like | date:'yyyy-MM-dd'">
            </div>
        </div>

    </form>
    <div class="row" style="margin-left:0px">
        <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
            <button type="button" class="btn btn-warning btn-block" ng-click="doQuery(queryData.ctime_tend);" >查询</button>
        </div>
        <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
            <button type="reset"  class="btn btn-default" ng-click="reset()">重置</button>
        </div>
        <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
            <button ui-sref="admin.lineOrder({id:data.purchaseOrderId})" class="btn btn-default" type="button" >明细</button>
        </div>
        <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
            <button ui-sref="purchasePrint({id:data.purchaseOrderId})" class="btn  btn-default" type="button" >打印</button>
        </div>
        <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
            <button ng-click="procurementCompletion(data.purchaseOrderId);" class="btn  btn-success" type="button" >采购完成</button>
        </div>
    </div>

    <div class="panel panel-default">

        <table class="table table-bordered table-condensed" >
            <thead>
            <tr>
                <th width="5%">#</th>
                <th width="10%">品类名称</th>
                <th width="10%">销售量</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="item in data.resultData">
                <th>{{$index+1}}</th>
                <th>
                    {{item.name}}
                </th>
                <th>
                    {{item.number}}
                </th>
            </tr>
            </tbody>
        </table>

        <div class="panel-footer" style="text-align: center;">
            <uib-pagination style="margin:0;" ng-change="pageChanged(data.currentPage)" total-items="data.totalSize" ng-model="data.currentPage"
                            items-per-page="data.pageSize" max-size="5" class="pagination-sm" boundary-links="true"
                            rotate="false"></uib-pagination>
        </div>

    </div>

    <div ng-if="!data" style="text-align: center">
        加载中...
    </div>

</div>